package router

import (
	"github.com/gin-gonic/gin"
	"szxf/controllers"
)

func InitRoute() *gin.Engine {
	r := gin.Default()

	apiRoute := r.Group("/api")
	{
		apiRoute.Any("/id_check", controllers.IdCheck)
		apiRoute.Any("/bank2_check", controllers.Bank2Check)
		apiRoute.Any("/bank3_check", controllers.Bank3Check)
		apiRoute.Any("/bank4_check", controllers.Bank4Check)
		apiRoute.Any("/phone3_check", controllers.Phone3Check)
	}

	apiTxRoute := apiRoute.Group("/ocr").Use(controllers.MiddleTxSign)
	{
		apiTxRoute.Any("/idcard", controllers.IdCard)
		apiTxRoute.Any("/idcard_base", controllers.IdCardBase)
		apiTxRoute.Any("/idcard_risk", controllers.IdCardRisk)
		apiTxRoute.Any("/idcard_photo", controllers.IdCardPhoto)
		apiTxRoute.Any("/bank_card", controllers.BankCard)
	}

	return r
}